<?php
if (!defined ('TYPO3_MODE')) 	die ('Access denied.');

$TCA["tx_enoteserver_note"] = Array (
	"ctrl" => $TCA["tx_enoteserver_note"]["ctrl"],
	"interface" => Array (
		"showRecordFieldList" => "hidden,title,directory,texfile,type,enote,collection,live"
	),
	"feInterface" => $TCA["tx_enoteserver_note"]["feInterface"],
	"columns" => Array (
		"hidden" => Array (		
			"exclude" => 1,
			"label" => "LLL:EXT:lang/locallang_general.xml:LGL.hidden",
			"config" => Array (
				"type" => "check",
				"default" => "0"
			)
		),
/*		"fe_group" => Array (		
			"exclude" => 1,
			"label" => "LLL:EXT:lang/locallang_general.xml:LGL.fe_group",
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("", 0),
					Array("LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login", -1),
					Array("LLL:EXT:lang/locallang_general.xml:LGL.any_login", -2),
					Array("LLL:EXT:lang/locallang_general.xml:LGL.usergroups", "--div--")
				),
				"foreign_table" => "fe_groups"
			)
		),
*/		"title" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.title",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"type" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.type",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.type.I.0", "0"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.type.I.1", "1"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.type.I.2", "2"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.type.I.3", "3"),
				),
				"size" => 1,	
				"maxitems" => 1,
			)
		),
		"enote" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.enote",		
			"config" => Array (
				"type" => "input",
				"size" => "4",
				"max" => "4",
				"eval" => "int",
				"checkbox" => "0",
				"range" => Array (
					"upper" => "1000",
					"lower" => "1"
				),
				"default" => 0
			)
		),
		"lastgeneratedflag" => Array (		
			"exclude" => 1,		
			"label" => "Last generated flag (uncheck to regenerate):",		
			"config" => Array (
				"type" => "input",
				"size" => "10",
				"eval" => "int",
				"checkbox" => "0"
			)
		),				
		"directory" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.directory",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"texfile" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.texfile",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"collection" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.collection",		
			"config" => Array (
				"type" => "select",	
				"foreign_table" => "tx_enoteserver_collection",	
				"foreign_table_where" => "AND tx_enoteserver_collection.pid=###STORAGE_PID### ORDER BY tx_enoteserver_collection.uid",	
				"size" => 1,	
				"minitems" => 0,
				"maxitems" => 1,
				"items" => Array (
					Array("", "0"),
				),
			)
		),
		"book" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.book",		
			"config" => Array (
				"type" => "select",	
				"foreign_table" => "tx_enoteserver_book",	
				"foreign_table_where" => "AND tx_enoteserver_book.pid=###STORAGE_PID### ORDER BY tx_enoteserver_book.title",	
				"size" => 1,	
				"minitems" => 0,
				"maxitems" => 1,
				"items" => Array (
					Array("", "0"),
				),
			)
		),
		"live" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_note.live",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("", 0),
					Array("Live", 1),
					Array("Live + Auto-update from preview", 2)
				),
			)
		),
		"svnauto" => Array (		
			"exclude" => 1,		
			"label" => "SVN mode",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("", 0),
					Array("SVN", 1),
					Array("SVN Auto update", 2),
					Array("Git (experimental)", 3)
				),
			)
		),
	),
	"types" => Array (
		"0" => Array("showitem" => "hidden;;1;;1-1-1, enote, title;;;;2-2-2, directory;;;;3-3-3, texfile, type, book,collection, live,lastgeneratedflag,svnauto")
	)
);



$TCA["tx_enoteserver_collection"] = Array (
	"ctrl" => $TCA["tx_enoteserver_collection"]["ctrl"],
	"interface" => Array (
		"showRecordFieldList" => "fe_group,title,description,license,managers"
	),
	"feInterface" => $TCA["tx_enoteserver_collection"]["feInterface"],
	"columns" => Array (
		"fe_group" => Array (		
			"exclude" => 1,
			"label" => "LLL:EXT:lang/locallang_general.xml:LGL.fe_group",
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("", 0),
					Array("LLL:EXT:lang/locallang_general.xml:LGL.hide_at_login", -1),
					Array("LLL:EXT:lang/locallang_general.xml:LGL.any_login", -2),
					Array("LLL:EXT:lang/locallang_general.xml:LGL.usergroups", "--div--")
				),
				"foreign_table" => "fe_groups"
			)
		),
		"title" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.title",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"description" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.description",		
			"config" => Array (
				"type" => "text",
				"cols" => "30",	
				"rows" => "5",
			)
		),
		"license" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.0", "0"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.1", "1"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.2", "2"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.3", "3"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.4", "4"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.5", "5"),
					Array("LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.license.I.6", "6"),
				),
				"size" => 1,	
				"maxitems" => 1,
			)
		),
		"managers" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_collection.managers",		
			"config" => Array (
				"type" => "group",	
				"internal_type" => "db",	
				"allowed" => "fe_users",	
				"size" => 10,	
				"minitems" => 0,
				"maxitems" => 10,
			)
		),
	),
	"types" => Array (
		"0" => Array("showitem" => "fe_group;;;;1-1-1, title;;;;2-2-2, description;;;;3-3-3, license, managers")
	),
	"palettes" => Array (
		"1" => Array("showitem" => "")
	)
);



$TCA["tx_enoteserver_book"] = Array (
	"ctrl" => $TCA["tx_enoteserver_book"]["ctrl"],
	"columns" => Array (
		"title" => Array (		
			"exclude" => 0,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_book.title",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"description" => Array (		
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_book.description",		
			"config" => Array (
				"type" => "text",
				"cols" => "30",	
				"rows" => "5",
			)
		),
		"bookdir" => Array (		
			"exclude" => 0,		
			"label" => "Book directory:",		
			"config" => Array (
				"type" => "input",	
				"size" => "30",	
				"eval" => "required",
			)
		),
		"encoding" => Array (		
			"exclude" => 1,		
			"label" => "Encoding for book (same as in preamble!)",		
			"config" => Array (
				"type" => "select",
				"items" => Array (
					Array("utf8", "0"),
					Array("latin1", "1"),
				),
				"size" => 1,	
				"maxitems" => 1,
			)
		),
		'flexform' => Array (
			"exclude" => 1,		
			"label" => "LLL:EXT:enoteserver/locallang_db.xml:tx_enoteserver_book.configuration",		
			"config" => array(
				'type' => 'flex',
				'ds' => array(
					'default' => 'FILE:EXT:enoteserver/flexform_cfg.xml',
				)
			)
		)
	),
	"types" => Array (
		"0" => Array("showitem" => "title;;;;2-2-2, description;;;;3-3-3, bookdir, encoding, flexform")
	)
);
?>